package com.feige.utils.file;

import org.apache.commons.lang3.StringUtils;

import java.io.File;
import java.util.Calendar;

/**
 * @author feige<br />
 * @ClassName: FsUtils <br/>
 * @Description: <br/>
 * @date: 2021/9/25 18:29<br/>
 */
public class FsUtils {

    public static final String FAST_DFS = "fast_dfs";
    public static final String OSS = "oss";
    public static final String LOCAL = "local";

    public static String joinFileName(String fileType){
        Calendar calendar = Calendar.getInstance();
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH);
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        return (StringUtils.isEmpty(fileType) ? "" : fileType + File.separator) + year + File.separator + month + File.separator + day;
    }

    public static String joinFileName(){
        return joinFileName(null);
    }
}
